using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._Iterator
{
    /// <summary>
    /// <para>Iterate Files</para>
    /// <para>Iterates over files in a folder.</para>
    /// <para>循环访问文件夹中的文件。</para>
    /// </summary>    
    [DisplayName("Iterate Files")]
    public class IterateFiles : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public IterateFiles()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_folder">
        /// <para>Folder</para>
        /// <para>Folder in which the input files are located.</para>
        /// <para>输入文件所在的文件夹。</para>
        /// </param>
        public IterateFiles(object _in_folder)
        {
            this._in_folder = _in_folder;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "Iterate Files";

        public override string CallName => "mb.IterateFiles";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_folder, _wildcard, _extension, _recursive.GetGPValue(), _file, _name];

        /// <summary>
        /// <para>Folder</para>
        /// <para>Folder in which the input files are located.</para>
        /// <para>输入文件所在的文件夹。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_folder { get; set; }


        /// <summary>
        /// <para>Wildcard</para>
        /// <para>A combination of * and characters that help to limit the results. The asterisk is the same as saying ALL. If no wildcard is specified, all inputs will be returned. For example, it can be used to restrict Iteration over input names starting with a certain character or word (for example, A* or Ari* or Land* and so on).</para>
        /// <para>* 和字符的组合，有助于限制结果。星号与说 ALL 相同。如果未指定通配符，则将返回所有输入。例如，它可用于限制对以特定字符或单词开头的输入名称（例如，A* 或 Ari* 或 Land* 等）的迭代。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Wildcard")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _wildcard { get; set; } = null;


        /// <summary>
        /// <para>FileType</para>
        /// <para>The file extension, such as TXT, ZIP, and so on. Only files with the extension will be iterated. Do not use a period before the file extension.</para>
        /// <para>文件扩展名，如 TXT、ZIP 等。只有扩展名的文件才会被迭代。不要在文件扩展名前使用句点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("FileType")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extension { get; set; } = null;


        /// <summary>
        /// <para>Recursive</para>
        /// <para><xdoc>
        ///   <para>Determines if all subfolders of the main folder will be recursively iterated through.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Will iterate through all subfolders.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Will not iterate through all subfolders.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定是否以递归方式循环访问主文件夹的所有子文件夹。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 将循环访问所有子文件夹。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会循环访问所有子文件夹。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Recursive")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _recursive_value _recursive { get; set; } = _recursive_value._false;

        public enum _recursive_value
        {
            /// <summary>
            /// <para>RECURSIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RECURSIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_RECURSIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_RECURSIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>File</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("File")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _file { get; set; }


        /// <summary>
        /// <para>Name</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Name")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _name { get; set; }


        public IterateFiles SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}